package com.romotc.joyin.bean;

import java.sql.Timestamp;

import com.romotc.oschina.bean.POJO;

/**
 * 客户分配 转让
 * @author Administrator
 *
 */
public class CustomerGrant extends POJO {
	/**
	 * 分配客户的方式
	 */
	public static final String Type_AutoGrants = "自动分配";

	/**
	 * 默认的级别
	 */
	public static final int Order_Default = 5;
	
	
	/**
	 * 客户id
	 */
	private long custId;
	public Customer customer()
	{
		if(custId < 1)
			return null;
		
		return CustomerService.qryCustomerById(custId);
	}
	
	
	/**
	 * 转让给哪个客服人员
	 */
	private long csId;
	
	/**
	 * 转让给哪个robotUser 一般都是转给自己(不能为空)
	 */
	private long toUid;
	
	/**
	 * 备注
	 */
	private String note;
	
	/**
	 * 客户分配时间
	 */
	private Timestamp grantTime = new Timestamp(System.currentTimeMillis());

	/**
	 * 授权级别 分发客户请求时按照级别由高到低的顺序分发(如果serviceOrder相同则同时分发)
	 */
	private int serviceOrder;

	
	
	public long getCustId() {
		return custId;
	}

	public void setCustId(long custId) {
		this.custId = custId;
	}

	public long getCsId() {
		return csId;
	}

	public void setCsId(long csId) {
		this.csId = csId;
	}

	public long getToUid() {
		return toUid;
	}

	public void setToUid(long toUid) {
		this.toUid = toUid;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public Timestamp getGrantTime() {
		return grantTime;
	}

	public void setGrantTime(Timestamp grantTime) {
		this.grantTime = grantTime;
	}

	
	public int getServiceOrder() {
		return serviceOrder;
	}

	public void setServiceOrder(int serviceOrder) {
		this.serviceOrder = serviceOrder;
	}

	public static void main(String[] args) {
		CustomerGrant grants = new CustomerGrant();
		grants.setCustId(523);
		System.out.println(grants.customer().getCustName());
	}
}
